feat(test): add testscript integration test framework#796
Merged
natalie-o-perret merged 6 commits intomasterfrom Feb 19, 2026
Merged
feat(test): add testscript integration test framework#796natalie-o-perret merged 6 commits intomasterfrom
natalie-o-perret merged 6 commits intomasterfrom
Conversation
- Add testscript library for declarative CLI testing - Create test runner with config isolation per test - Add example test scenarios for basic CLI commands - Configure GitHub Actions workflow for CI - Use scenarios/ directory for test files This provides a more maintainable and readable alternative to the existing Go-based integration tests, with automatic config isolation and better support for both local and CI environments. Scenarios directory can be customized by changing Dir parameter in testscript.Run(). Tests use runtime.Caller() to locate CLI root, ensuring correct path resolution regardless of working directory. The framework supports: - Config file isolation via XDG_CONFIG_HOME redirection - Environment variable credential forwarding - Parallel test execution - Both unit tests (no API) and integration tests (with API)
- Remove outdated comment about interactive config add - Add TODO for making test flags parametrizable per scenario - Document need for org account setup in future PR for API tests - Add scenarios/README.md explaining current and future test coverage
nerzhul
reviewed
Feb 19, 2026
The integration-tests job is commented out until actual API test scenarios are added in a future PR, since currently no testscript scenarios require API credentials.
Instead of building the binary within the test code, use the binary from the existing build pipeline (bin/exo). This: - Eliminates redundant builds in test code - Tests the actual build artifact from the pipeline - Aligns with existing test infrastructure (blockstorage_test.go) - Improves test execution speed GitHub Actions workflow now runs 'make build' before tests.
imiric
approved these changes
Feb 19, 2026
Member
imiric
left a comment
There was a problem hiding this comment.
Very cool! I wasn't familiar with testscript. It seems very convenient for CLI testing, and the fact it's used internally by the Go team is a strong signal of confidence. In personal projects I've usually designed my commands so that they're testable at the highest CLI layer, which avoids the overhead of having to build a binary, but this approach actually tests the end user interface, which is great.
No significant feedback from me, just a minor suggestion/question. Great contribution! 👏
- Move testscript scenarios from internal/integ/ to tests/e2e/ - Move programmatic tests from internal/integ/ to tests/integ/ - Rename unit/integration terminology to local/api for clarity - Update build tags from 'integration' to 'api' - Rename test functions: TestScriptsUnit → TestScriptsLocal, TestScriptsIntegration → TestScriptsAPI - Update GitHub Actions workflow for new structure and build tags - Update documentation to reflect new organization This provides cleaner separation between: - tests/e2e/: Declarative testscript scenarios (local vs api) - tests/integ/: Programmatic Go tests with suite helpers Both test approaches are end-to-end from CLI user perspective, just different implementation styles.
pierre-emmanuelJ
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This provides a more maintainable and readable alternative to the existing Go-based integration tests, with automatic config isolation and better support for both local and CI environments.
Scenarios directory can be customized by changing
Dirparameter intestscript.Run(). Tests useruntime.Caller()to locate CLI root, ensuring correct path resolution regardless of working directory.The framework supports:
XDG_CONFIG_HOMEredirectionChecklist
(For exoscale contributors)